<template>
  <div class="appPage">
    <!--    <div class="crumbs">-->
    <!--      <el-breadcrumb separator="/">-->
    <!--        <el-breadcrumb-item>-->
    <!--          基础表格-->
    <!--        </el-breadcrumb-item>-->
    <!--      </el-breadcrumb>-->
    <!--    </div>-->
    <h3 class="tit">用户管理</h3>
    <div class="search">
      <div class="left">
        <div class="item">
          <span class="lab_tit">企业编号</span>
          <el-input
            v-model="query.name"
            placeholder="请输入企业编号"
            class="handle-input mr10"
          ></el-input>
        </div>
        <div class="item">
          <span class="lab_tit">手机号</span>
          <el-input
            v-model="query.name"
            placeholder="请输入手机号"
            class="handle-input mr10"
          ></el-input>
        </div>
        <div class="item">
          <span class="lab_tit">状态</span>
          <el-select v-model="value" placeholder="请选择">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </div>

        <el-button
          type="primary"
          icon="el-icon-search"
          @click="handleSearch"
          class="searchBtn"
          >查找</el-button
        >
      </div>
      <!-- 隔离 -->
      <div class="partition"></div>

      <div class="right">
        <el-button
          class="reset"
          type="primary"
          icon="el-icon-refresh"
          @click="reset()"
          >重置</el-button
        >
        <el-button type="primary" class="add">解除</el-button>
        <el-button type="primary" class="add">禁止</el-button>
      </div>
    </div>
    <div class="container">
      <el-table
        :data="tableData"
        border
        class="table"
        ref="multipleTable"
        header-cell-class-name="table-header"
        @selection-change="handleSelectionChange"
      >
        <el-table-column
          type="selection"
          width="55"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="用户id"
          label="用户id"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="企业编号"
          label="企业编号"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="姓名"
          label="姓名"
          align="center"
        ></el-table-column>
        <!--        <el-table-column label="账户余额">-->
        <!--          <template #default="scope">￥{{ scope.row.money }}</template>-->
        <!--        </el-table-column>-->
        <!--        <el-table-column prop="电话" label="电话" align="center"></el-table-column>-->
        <el-table-column
          prop="余额"
          label="余额"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="费率"
          label="费率"
          align="center"
        ></el-table-column>
        <!--        <el-table-column prop="今日消费" label="今日消费" align="center"></el-table-column>-->
        <!--        <el-table-column prop="创建时间" label="创建时间" align="center"></el-table-column>-->
        <el-table-column
          prop="状态"
          label="状态"
          align="center"
        ></el-table-column>
        <el-table-column label="操作" width="180" align="center">
        </el-table-column>
      </el-table>
      <div class="pagination">
        <el-pagination
          background
          layout="total, prev, pager, next"
          :current-page="query.pageIndex"
          :page-size="query.pageSize"
          :total="pageTotal"
          @current-change="handlePageChange"
        ></el-pagination>
      </div>
    </div>
    <!-- 编辑弹出框 -->
    <el-dialog title="编辑" v-model="editVisible" width="30%">
      <el-form ref="form" :model="form" label-width="70px">
        <el-form-item label="用户名">
          <el-input v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item label="地址">
          <el-input v-model="form.address"></el-input>
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="editVisible = false">取 消</el-button>
          <el-button type="primary" @click="saveEdit">确 定</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "xnum",
  data() {
    return {
      query: {
        address: "",
        name: "",
        pageIndex: 1,
        pageSize: 10,
      },
      tableData: [],
      multipleSelection: [],
      delList: [],
      editVisible: false,
      pageTotal: 0,
      form: {},
      idx: -1,
      id: -1,
      options: [
        {
          value: "选项1",
          label: "正常",
          disabled: true,
        },
        {
          value: "选项2",
          label: "禁止",
        },
      ],
      value: "",
    };
  },
  created() {},
  methods: {
    // 分页导航
    handlePageChange(val) {
      this.$set(this.query, "pageIndex", val);
      this.getData();
    },
  },
};
</script>

<style scoped>
.tit {
  font-weight: normal;
  font-size: 36px;
  color: #333333;
}
.search {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.left {
  display: flex;
  align-items: center;
}
.item{
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-left: 30px;
}
.lab_tit{
  display: block;
  text-align: left;
}
.el-input{
  flex: 1;
  margin-left: 15px;
}
.el-select{
  flex: 1;
  margin-left: 15px;
}
.item:nth-child(1){
  margin-left: 0;
}
.searchBtn {
  margin-left: 15px;
}
.right {
  display: flex;
  justify-content: flex-end;
}
.reset {
  width: 90px;
  height: 34px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.add {
  margin-left: 15px;
}
.container {
  margin-top: 20px;
}
</style>
